package cn.laixueit.exception;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class MyException {

    @ExceptionHandler(RuntimeException.class)
    public String ex(Exception exception, Model model){
        model.addAttribute("msg",";"+exception.getMessage());
        return "500";
    }
}
